<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .add {
        width: 20px;
        height: 20px;
        background-color: tomato;
        border-radius: 50%;
        /* 绝对定位 */
        position: fixed;
        left: 800px;
        bottom: 600px;
      }
      .parabola {
        transition-duration: 1s; /* 过渡时间 */
        transition-property: left, bottom; /* 过渡属性 */
        transition-timing-function: ease, cubic-bezier(0.25, -0.55, 0.83, 0.13);
      }
      .end-state {
        /* 修改 left 与 bottom 的值 */
        left: 100px;
        bottom: 60px;
      }
    </style>
  </head>
  <body>
    <div class="add parabola"></div>
    <script>
      let add = document.querySelector(".add"); /* 获取添加按扭 */
      add.onclick = function () {
        /* 给按扭加上 end-state class */
        this.classList.add("end-state");
      };
    </script>
  </body>
</html>
